﻿@model S4Store.Domain.ImproveGuide
@{
    ViewBag.Title = "Add";
    Layout = null;
}
<form class="pageForm addpage" action="@Url.Action("Add")" method="post">
    <div style=" height:100%; width:100%; overflow:hidden" class="verticalSplitContainer">
        <div class="pageFormContent" style="overflow: auto;" ratio="*">
            <input type="hidden" value="@Model.StoreId" name="StoreId" />
            <input type="hidden" value="@Model.Type" name="Type" />
            <input type="hidden" value="@Model.ReferenceUrl" name="ReferenceUrl" />
            <input type="hidden" value="@Model.ReferenceDesc" name="ReferenceDesc" />
            <input type="hidden" value="1" name="StatusValue" />
            <table style="width:100%; height:100%;"  class="verticalSplitContainer">
                <tr ratio="#30">
                    <td>指导建议类型：@Model.GuideType.GetDescription()</td>
                </tr>
                <tr  ratio="#30">
                    <td >填写改善指导建议内容：</td>
                </tr>  
                <tr ratio="*">
                    <td  style=" height:100%;">
                        <textarea name="ImproveContent" style="width:100%; height:100%;">@Model.ImproveContent</textarea>
                    
                    
                    </td>
                </tr> 
            </table>
			
        </div>
        <div class="formBar" ratio="#30">
            <ul>
                <li><div class="simplebutton"><div class="r"><button type="button" class="submit" id="igsend" >发送</button></div></div></li>	
                <li><div class="simplebutton"><div class="r"><button type="button" class="submit" id="igsave">保存</button></div></div></li>	
            </ul>
        </div>
    </div>
    <script type="text/javascript">
        $(function() {
            $("#igsave").click(function() {
                $("input[name=StatusValue]").val(1);
                if (!$("textarea[name=ImproveContent]").val()) {
                    return false;
                }
                $(this).attr("disabled", "disabled");
                $("#igsend").attr("disabled", "disabled");
            });
            
            $("#igsend").click(function () {
                $("input[name=StatusValue]").val(2);
                if (!$("textarea[name=ImproveContent]").val()) {
                    return false;
                }
                $(this).attr("disabled", "disabled");
                $("#igsave").attr("disabled", "disabled");
            });
        });
    </script>
</form>

